package one.stand.controller;

import one.stand.entity.excel.BusinessExcelEntity;
import one.stand.model.ResultModel;
import one.stand.request.BusinessCardRequest;
import one.stand.request.CompanyRequest;
import one.stand.response.BusinessCardResponse;
import one.stand.util.ExportDataDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 企业成员
 *
 * @author Administrator
 */
@RestController
@RequestMapping("businessCard")
public class BusinessCardController extends BaseController {

    /**
     * 审核名片
     *
     * @param request
     * @return
     */
    @PostMapping("auditBusinessCard")
    public ResultModel auditBusinessCard(@RequestBody BusinessCardRequest request) {
        return businessCardService.auditBusinessCard(request);
    }

    /**
     * 查询用户列表
     *
     * @param request
     * @return
     */
    @PostMapping("selectCustomerList")
    public ResultModel<Map<String, Object>> selectCustomerList(@RequestBody BusinessCardRequest request) {
        return businessCardService.selectCustomerList(request);
    }

    /**
     * 导出用户列表
     *
     * @param request
     * @return
     */
    @PostMapping("selectCustomerListExport")
    public ResultModel<ExportDataDTO<BusinessExcelEntity>> selectCustomerListExport(@RequestBody BusinessCardRequest request) {
        return businessCardService.selectCustomerListExport(request);
    }

    /**
     * 查询用户信息
     *
     * @param request
     * @return
     */
    @PostMapping("getCustomerInfo")
    public ResultModel<BusinessCardResponse> getCustomerInfo(@RequestBody BusinessCardRequest request) {
        return businessCardService.getCustomerInfo(request);
    }

    /**
     * 禁用用户
     *
     * @param request
     * @return
     */
    @PostMapping("stopCustomer")
    public ResultModel<Boolean> stopCustomer(@RequestBody BusinessCardRequest request) {
        return businessCardService.stopCustomer(request);
    }
}
